home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 July / macformat-026.iso / mac / Shareware City / Developers / PopupCDEF-10b5 / Source / PopupCDEF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  3.2 KB  |  86 lines  |  [TEXT/KAHL]

  1. /* See the file Distribution for distribution terms.
  2.     (c) Copyright 1994 Ari Halberstadt */
  3.  
  4. /* This file contains definitions for using my popup CDEF.
  5.     94/03/15 aih - split out of PopupLib.h */
  6.  
  7. #pragma once
  8. #ifndef POPUP_CDEF
  9. #define POPUP_CDEF
  10.  
  11. /* Version of this library. Useful for compatability between older versions
  12.     of the CDEF and using a newer version of the popup library to manipulate
  13.     the CDEF popups from within a program. The program must first check the
  14.     popup's version before calling any popup library routines. */
  15. #define kPopupVersion                    (3)
  16.  
  17. /* Part codes. */
  18. #define kPopupPartCode                    (1)    /* returned when the mouse is in a popup control */
  19.  
  20. /*    Part codes used for specifying colors in a control's color table. */
  21.  
  22. #define kPopupPartTitleFore            (256)    /* title string */
  23. #define kPopupPartTitleBack            (257)    /* title rectangle */
  24. #define kPopupPartTitleDisabled        (258)    /* disabled title string */
  25.  
  26. #define kPopupPartItemFore                (259)    /* current item string */
  27. #define kPopupPartItemBack                (260)    /* current item rectangle */
  28. #define kPopupPartItemDisabled        (261)    /* disabled current item string */
  29.  
  30. #define kPopupPartIconFore                (262) /* current item icon */
  31. #define kPopupPartIconBack                (263) /* background of current item icon */
  32. #define kPopupPartIconDisabled        (264) /* disabled current item icon */
  33.  
  34. #define kPopupPartTriangleFore        (265)    /* triangle */
  35. #define kPopupPartTriangleBack        (266)    /* background of triangle */
  36. #define kPopupPartTriangleDisabled    (267)    /* disabled triangle */
  37.  
  38. #define kPopupPartFrameFore            (268)    /* frame around current item */
  39. #define kPopupPartFrameBack            (269)    /* background of frame around current item */
  40. #define kPopupPartFrameDisabled        (270)    /* disabled frame around current item */
  41.  
  42. #define kPopupPartShadowFore            (271)    /* drop shadow */
  43. #define kPopupPartShadowBack            (272)    /* background of drop shadow */
  44. #define kPopupPartShadowDisabled        (273)    /* disabled drop shadow */
  45.  
  46. /*    When using the popupTypeIn variation code, only the popup's triangle
  47.     is drawn, and the popup's title and current selection are not drawn.
  48.     Type-in popup menus are described in IM-VI, p2-37. */
  49. #define kPopupTypeIn                        (2)
  50. #define popupTypeIn                        kPopupTypeIn
  51.  
  52. /* The procID for the popup CDEF. You can use this value in calls
  53.     to NewControl. This assumes that the resource ID of the CDEF
  54.     is 129. You can use any ID for the CDEF resource, but you will
  55.     have to multiply the ID by 16 to get the procID value to use
  56.     in calls to NewControl. */
  57. #define kPopupProcID                        (129 * 16)
  58.  
  59. #if ! POPUP_CDEF_RESOURCE_ONLY
  60.  
  61. #ifndef __CONTROLS__
  62. #include <Controls.h>
  63. #endif
  64.  
  65. #ifndef __MENUS__
  66. #include <Menus.h>
  67. #endif
  68.  
  69. /*    This is the same structure as the popupPrivateData record described
  70.     in IM-VI, p3-19. By making this the first element in the popup
  71.     structure, the CDEF is made more compatible with Apple's CDEF. */
  72. #if defined(powerc) || defined(__powerc)
  73.     #pragma options align=mac68k
  74. #endif
  75. typedef struct {
  76.     MenuHandle    mHandle;            /* handle to the popup's menu */
  77.     short            mID;                /* id of popup's menu */
  78. } PopupPrivateType, *PopupPrivatePtr, **PopupPrivateHandle;
  79. #if defined(powerc) || defined(__powerc)
  80.     #pragma options align=reset
  81. #endif
  82.  
  83. #endif /* POPUP_CDEF_RESOURCE_ONLY */
  84.  
  85. #endif /* POPUP_CDEF */
  86.